http://blog.csdn.net/cunxiyuan108/article/details/5989701CHR (CharCode)The necessary charcode parameter is a Long that is used to identify a character. Charcode:ascii yardsEach word has its own ASCII To know the ASCII code of a word, write a VB program:Msgbox CStr (ASC (the character to be known, to be enclosed in ""))This code can tell you.This function is useful, and some input methods cannot be used to generate the word (to know the ASCII of this word)Numbers from 0 to 31 are the same as st
style.After understanding the principle, we can use the program to implement it. We use the Response. BinaryWrite method to write the file header, and then use the program to write the file body.The following is a program used to generate the IP address of the browser:Response. Expires =-9999Response. AddHeader "cache-control", "no-cache"Response. ContentType = "Image/BMP"Const cCode = "0123456789." 'Data ValueDim vColor (2)VColor (0) = ChrB (0)
The code is as follows
Copy Code
Call Com_creatvalidcode ("code") Sub Com_creatvalidcode (PSN)' Disable cachingResponse.Expires =-9999Response.AddHeader "Pragma", "No-cache"Response.AddHeader "Cache-ctrol", "No-cache"' Response.ContentType = ' image/bmp 'RandomizeDim I, II, IIIConst Codds = 0 ' Odds of occurrence of miscellaneous pointsConst Camount = 36 ' text quantityConst ccode = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"' Color data (character, background)Dim Vcolordata (1), Vco
Purpose: use ASP
Program Generate an image format for the phone number on the page.
CopyCode The Code is as follows: Call com_creatvalidcode (request. querystring ("tel "))
Public sub com_creatvalidcode (ptel)
'---------- Disable caching
Response. expires = 0
Response. addheader "Pragma", "No-Cache"
Response. addheader "cache-ctrol", "No-Cache"
Response. contenttype = "image/BMP"
Randomize
Dim I, II, III, rndcolor, strlen, SQL, RS
Const codds = 5' ------------ probability of occurrence of misc
The following is a reference fragment:
Call Com_creatvalidcode (Request.QueryString ("tel"))Public Sub Com_creatvalidcode (Ptel)'----------Prohibit cachingResponse.Expires = 0Response.AddHeader "Pragma", "No-cache"Response.AddHeader "Cache-ctrol", "No-cache"Response.ContentType = "Image/bmp"RandomizeDim I, II, III, RNDCOLOR,STRLEN,SQL,RSConst Codds = 5 ' Probability of the occurrence of the miscellaneous points of the------------Const str= "0123456789-"StrLen = Len (Ptel)Rndcolor =
Function: Create a picture format for the phone number in the page.
Copy Code code as follows:
Call Com_creatvalidcode (Request.QueryString ("tel"))
Public Sub Com_creatvalidcode (Ptel)
'----------Prohibit caching
Response.Expires = 0
Response.AddHeader "Pragma", "No-cache"
Response.AddHeader "Cache-ctrol", "No-cache"
Response.ContentType = "Image/bmp"
Randomize
Dim I, II, III, RNDCOLOR,STRLEN,SQL,RS
Const Codds = 5 ' Probability of the occurrence of the miscellane
Function: Use ASP program to generate picture format of phone number in the page.
Copy Code code as follows:
Call Com_creatvalidcode (Request.QueryString ("tel"))
Public Sub Com_creatvalidcode (Ptel)
'----------Prohibit caching
Response.Expires = 0
Response.AddHeader "Pragma", "No-cache"
Response.AddHeader "Cache-ctrol", "No-cache"
Response.ContentType = "Image/bmp"
Randomize
Dim I, II, III, RNDCOLOR,STRLEN,SQL,RS
Const Codds = 5 ' Probability of the occurrence of the miscel
Function: Use ASP program to generate picture format of phone number in the page.
The following is a reference fragment:
The following are the referenced contents: Call Com_creatvalidcode (Request.QueryString ("tel"))Public Sub Com_creatvalidcode (Ptel)'----------Prohibit cachingResponse.Expires = 0Response.AddHeader "Pragma", "No-cache"Response.AddHeader "Cache-ctrol", "No-cache"Response.ContentType = "Image/bmp"RandomizeDim I, II, III, RNDCOLOR,STRLEN,SQL,RSConst Codds = 5 ' Prob
, ii, iii
Const cAmount = 10' number of values
Const cCode = "0123456789" 'value range
Dim vColorData (2)
VColorData (0) = "" 'black points must be converted to color points, which are not defined at the moment
VColorData (1) = ChrB (255) ChrB (255) ChrB (255) 'White spot
Dim vCode (4), vCodes 'generates a group of arbitrary numbers
For I = 0 To 3
VCode (I) = I
()
Randomize
Dim I, II, III
Const Camount = 10 ' Number of values
Const ccode = "0123456789" ' Numerical range
Dim Vcolordata (2)
Vcolordata (0) = "" ' Black point to be converted to colored dots, temporarily undefined
Vcolordata (1) = ChrB (255) ChrB (255) ChrB (255) ' White dots
Dim Vcode (4), Vcodes ' produces a set of arbitrary numb
Asp output bmp
[12:04:25 | Author: flashsoft]
Font size: large | medium | small
Call Com_CreatValidCode ("ValidCode ")
Sub Com_CreatValidCode (pSN)
'Author: Layen'Qq: 84815733'E-mail: support@ssaw.net
'Prohibit cachingResponse. Expires =-9999Response. AddHeader "Pragma", "no-cache"Response. AddHeader "cache-ctrol", "no-cache"Response. ContentType = "Image/BMP"
Randomize
Dim I, ii, iii
Const cOdds = 8' probability of occurrence of miscellaneousConst cAmount = 36' text countConst cCode = "0123456
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.